package com.learning.server.thread;

public class SynchronizedDemo2 {
    volatile int good;

    public static void main(String[] args) {
        synchronized (SynchronizedDemo2.class) {
        }
        method();
    }

    private static void method() {

        int n = 18 - 1;
        System.out.println(n >> 1);
        System.out.println(n >>> 1);
        n |= n >>> 1;
        System.out.println(n);
        n |= n >>> 2;
        System.out.println(n);
        n |= n >>> 4;
        System.out.println(n);
        n |= n >>> 8;
        System.out.println(n);
        n |= n >>> 16;
        System.out.println(n);

        //n     10001 17
        //n>>>1 1000  8
        //n |= n>>>1  10001 | 01000 = 11001 25
        //n |= n>>>2  11001 | 00110 = 11111 31
    }
}
